home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / me_cd25.zip / MUTT2.ZIP / NOMUNGE.MUT < prev    next >
Text File  |  1992-11-09  |  1KB  |  50 lines

  1.   ;; nomunge.mut :
  2.   ;; Make the file in the current buffer unmungeable - ie allow
  3.   ;;   no changes to buffer contents.
  4.   ;; Note that this method is full of holes but works OK for people not
  5.   ;;   going out of their way to munge the buffer.
  6.   ;; C Durland    Public Domain
  7.  
  8. (include me2.h)
  9.  
  10. (defun
  11.   self-nomunge { (msg "buffer unmungeable!") }
  12.   nomungeCR { (forward-line 1) }
  13.   buffer-nomunge
  14.   {
  15.     (small-int i)
  16.  
  17.     (for (i 0x20) (< i 0x7F) (+= i 1)
  18.       (bind-local-key "self-nomunge" (convert-to CHARACTER i)))
  19.  
  20.     (bind-local-key "self-nomunge"    "C-d")
  21.     (bind-local-key "self-nomunge"    "C-H")
  22.     (bind-local-key "self-nomunge"    "C-d")
  23.     (bind-local-key "self-nomunge"    "C-xC-s")
  24.     (bind-local-key "self-nomunge"     "C-q")
  25.     (bind-local-key "self-nomunge"    "C-k")
  26.     (bind-local-key "self-nomunge"    "C-o")
  27.     (bind-local-key "self-nomunge"    "M-Q")
  28.     (bind-local-key "self-nomunge"    "C-T")
  29.     (bind-local-key "self-nomunge"    "C-I")
  30.     (bind-local-key "self-nomunge"    "C-Y")
  31.     (bind-local-key "self-nomunge"    "M-d")
  32.  
  33.     (bind-local-key "nomungeCR"        "C-m")
  34.     (bind-local-key "nomungeCR"        "C-j")
  35.  
  36.     (file-name -1 "")
  37.     (buffer-flags -1 BFFoo)
  38.     (local-modeline-hook "nomunge-modeline")
  39.   }
  40.   nomunge-modeline
  41.   {
  42.     (concat
  43.       "!!!!!!!!!!!!!!!!!"
  44.       (buffer-name -1)
  45.       " is READ ONLY"
  46.       "!"
  47.     )
  48.   }
  49. )
  50.